Skip to main content

TRREST_APIRESPONSE

This project covers all the test cases of REST trigger and APIRESPONSE transformer.

Sr. NoService NameDescriptionDetails
1.getSingleRecordgetSingleRecord having GEN mapping. Create rest trigger to get customer data from DB and map the single record with GEN. Target keys will change
2.getStatusCodeGlobalget status code from global variables and content-type text/plain
3.getMultipleRecordgetMultipleRecord having AR mapping. Create rest trigger to get customers data from DB and map the multiple record with GEN. Target keys will change
4.getArrayResponseget array in response and content-type application/json
5.getArrayResponseTxtget array in response and content-type text/plain and status-code 202
6.getFirstObjectGet first record from array using CN
7.postCNOBJUsage of Transformer where both input and output are JSON in REST POST request (ouput request_payload) TRansform in Java object. IN APIResponse using CN send data back as with content-type as application/json
{
"ID": 1,
"Name": "Minal",
"LastName": "Deshpande",
"FirstName": "Minal",
"phone": "40.32.2555",
"Address1": "Pune",
"Address2": null,
"city": "Pune",
"state": null,
"pincode": "411007",
"country": "India",
"salesRepEmployeeNumber": 1702,
"creditLimit": 1451.25
}
8.postTransUtilsUse of few inline functions: 1. Use `Strings.concat` method to concatenate 2 or more strings with an underscore `-` between them and `Utils.constant` to get a constant value. 2. Use `Strings.toUppercase` method to convert string to uppercase. 3. Use `Maths.add` method for addition of static and dynamic values with datatype `Number`. 4. Use `Strings.isAlphanumeric` to check if given text contains only letters and numbers. 5. Use `Maths.add` method for addition of static and dynamic values with datatype `Double`. 6. Use `Date.DateTime` method to get the current date and time.
{
"name": "John Doe",
"num1": 12,
"num2": 34,
"num3": 50,
"price": 133,
"text": "This sentence contains alphanumeric characters 00"
}
9.postJSONgetJSONinput is json APIRESPONSE component Content-Type-> application/json use CN with request_payload
{
"ID": 1,
"Name": "Minal",
"LastName": "Deshpande",
"FirstName": "Minal",
"phone": "40.32.2555",
"Address1": "Pune",
"Address2": null,
"city": "Pune",
"state": null,
"pincode": "411007",
"country": "India",
"salesRepEmployeeNumber": 1702,
"creditLimit": 1451.25
}
10.postJSONgetXMLinput is json APIRESPONSE component Content-Type-> application/xml use CN with request_payload
{
"ID": 1,
"Name": "Minal",
"LastName": "Deshpande",
"FirstName": "Minal",
"phone": "40.32.2555",
"Address1": "Pune",
"Address2": null,
"city": "Pune",
"state": null,
"pincode": "411007",
"country": "India",
"salesRepEmployeeNumber": 1702,
"creditLimit": 1451.25
}
11.postJSONgetCSVinput is json APIRESPONSE component Content-Type-> text/csv use CN with request_payload
{
"ID": 1,
"Name": "Minal",
"LastName": "Deshpande",
"FirstName": "Minal",
"phone": "40.32.2555",
"Address1": "Pune",
"Address2": null,
"city": "Pune",
"state": null,
"pincode": "411007",
"country": "India",
"salesRepEmployeeNumber": 1702,
"creditLimit": 1451.25
}
12.postJsonArrGetCsvinput is json APIRESPONSE component Content-Type-> text/csv use CN with request_payload
[
{
"ID": 1,
"Name": "Minal",
"LastName": "Deshpande",
"FirstName": "Minal",
"phone": "40.32.2555",
"Address1": "Pune",
"Address2": null,
"city": "Pune",
"state": null,
"pincode": "411007",
"country": "India",
"salesRepEmployeeNumber": 1702,
"creditLimit": 1451.25
}
]
13.postJSONgetTXTinput is json APIRESPONSE component Content-Type-> text/plain use CN with request_payload
{
"ID": 1,
"Name": "Minal",
"LastName": "Deshpande",
"FirstName": "Minal",
"phone": "40.32.2555",
"Address1": "Pune",
"Address2": null,
"city": "Pune",
"state": null,
"pincode": "411007",
"country": "India",
"salesRepEmployeeNumber": 1702,
"creditLimit": 1451.25
}
14.postXMLgetJSONinput is json APIRESPONSE component Content-Type-> application/json use CN with request_payload
<Customer>
<ID>1</ID>
<Name>Minal</Name>
<LastName>Deshpande</LastName>
<FirstName>Minal</FirstName>
<phone>40.32.2555</phone>
<Address1>Pune</Address1>
<Address2/>
<city>Pune</city>
<state/>
<pincode>411007</pincode>
<country>India</country>
<salesRepEmployeeNumber>1702</salesRepEmployeeNumber>
<creditLimit>1451.25</creditLimit>
</Customer>
15.postXMLgetXMLinput is json APIRESPONSE component Content-Type-> application/xml use CN with request_payload
<Customer>
<ID>1</ID>
<Name>Minal</Name>
<LastName>Deshpande</LastName>
<FirstName>Minal</FirstName>
<phone>40.32.2555</phone>
<Address1>Pune</Address1>
<Address2/>
<city>Pune</city>
<state/>
<pincode>411007</pincode>
<country>India</country>
<salesRepEmployeeNumber>1702</salesRepEmployeeNumber>
<creditLimit>1451.25</creditLimit>
</Customer>
16.postXMLgetCSVinput is json APIRESPONSE component Content-Type-> text/csv use CN with request_payload
<Customer>
<ID>1</ID>
<Name>Minal</Name>
<LastName>Deshpande</LastName>
<FirstName>Minal</FirstName>
<phone>40.32.2555</phone>
<Address1>Pune</Address1>
<Address2/>
<city>Pune</city>
<state/>
<pincode>411007</pincode>
<country>India</country>
<salesRepEmployeeNumber>1702</salesRepEmployeeNumber>
<creditLimit>1451.25</creditLimit>
</Customer>
17.postXMLgetTXTinput is json APIRESPONSE component Content-Type-> text/plain use CN with request_payload
<Customer>
<ID>1</ID>
<Name>Minal</Name>
<LastName>Deshpande</LastName>
<FirstName>Minal</FirstName>
<phone>40.32.2555</phone>
<Address1>Pune</Address1>
<Address2/>
<city>Pune</city>
<state/>
<pincode>411007</pincode>
<country>India</country>
<salesRepEmployeeNumber>1702</salesRepEmployeeNumber>
<creditLimit>1451.25</creditLimit>
</Customer>
18.postCSVgetJSONinput is json APIRESPONSE component Content-Type-> application/json use CN with request_payload
ID,Name,LastName,FirstName,phone,Address1,Address2,city,state,pincode,country,salesRepEmployeeNumber,creditLimit
1,Minal,Deshpande,Minal,40.32.2555,Pune,,Pune,,411007,India,1702,1451.25
19.postCSVgetXMLinput is json APIRESPONSE component Content-Type-> application/xml use CN with request_payload
ID,Name,LastName,FirstName,phone,Address1,Address2,city,state,pincode,country,salesRepEmployeeNumber,creditLimit
1,Minal,Deshpande,Minal,40.32.2555,Pune,,Pune,,411007,India,1702,1451.25
20.postCSVgetCSVinput is json APIRESPONSE component Content-Type-> text/csv use CN with request_payload
ID,Name,LastName,FirstName,phone,Address1,Address2,city,state,pincode,country,salesRepEmployeeNumber,creditLimit
1,Minal,Deshpande,Minal,40.32.2555,Pune,,Pune,,411007,India,1702,1451.25
21.postCSVgetTXTinput is json APIRESPONSE component Content-Type-> text/plain use CN with request_payload
ID,Name,LastName,FirstName,phone,Address1,Address2,city,state,pincode,country,salesRepEmployeeNumber,creditLimit
1,Minal,Deshpande,Minal,40.32.2555,Pune,,Pune,,411007,India,1702,1451.25
22.postTXTgetJSONinput is json APIRESPONSE component Content-Type-> application/json use CN with request_payload
ID,Name,LastName,FirstName,phone,Address1,Address2,city,state,pincode,country,salesRepEmployeeNumber,creditLimit
1,Minal,Deshpande,Minal,40.32.2555,Pune,,Pune,,411007,India,1702,1451.25
23.postTXTgetXMLinput is json APIRESPONSE component Content-Type-> application/xml use CN with request_payload
ID,Name,LastName,FirstName,phone,Address1,Address2,city,state,pincode,country,salesRepEmployeeNumber,creditLimit
1,Minal,Deshpande,Minal,40.32.2555,Pune,,Pune,,411007,India,1702,1451.25
24.postTXTgetCSVinput is json APIRESPONSE component Content-Type-> text/csv use CN with request_payload
ID,Name,LastName,FirstName,phone,Address1,Address2,city,state,pincode,country,salesRepEmployeeNumber,creditLimit
1,Minal,Deshpande,Minal,40.32.2555,Pune,,Pune,,411007,India,1702,1451.25
25.postTXTgetTXTinput is json APIRESPONSE component Content-Type-> text/plain use CN with request_payload
ID,Name,LastName,FirstName,phone,Address1,Address2,city,state,pincode,country,salesRepEmployeeNumber,creditLimit
1,Minal,Deshpande,Minal,40.32.2555,Pune,,Pune,,411007,India,1702,1451.25